package com.qiaoba.module.system.entity.dto;

import com.qiaoba.common.base.validate.AddGroup;
import com.qiaoba.common.base.validate.EditGroup;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.io.Serializable;

/**
 * 字典数据 DTO
 *
 * @author ailanyin
 * @date 2023-09-10 16:53:42
 */
@Data
public class SysDictDataDTO implements Serializable {

    private static final long serialVersionUID = 1L;

    @NotNull(message = "主键不能为空", groups = {EditGroup.class})
    @Size(max = 20, message = "主键不能超过{max}个字符", groups = {EditGroup.class})
    private String dictCode;

    @Schema(description = "字典排序")
    @Min(value = 1, message = "字典排序最小为{value}", groups = {AddGroup.class, EditGroup.class})
    private Integer dictSort;

    @Schema(description = "字典标签")
    @NotBlank(message = "字典标签不能为空", groups = {AddGroup.class, EditGroup.class})
    @Size(max = 100, message = "字典标签不能超过{max}个字符", groups = {AddGroup.class, EditGroup.class})
    private String dictLabel;

    @Schema(description = "字典键值")
    @NotBlank(message = "字典键值不能为空", groups = {AddGroup.class, EditGroup.class})
    @Size(max = 100, message = "字典键值不能超过{max}个字符", groups = {AddGroup.class, EditGroup.class})
    private String dictValue;

    @Schema(description = "字典类型")
    @NotBlank(message = "字典类型不能为空", groups = {AddGroup.class, EditGroup.class})
    @Size(max = 100, message = "字典类型不能超过{max}个字符", groups = {AddGroup.class, EditGroup.class})
    private String dictType;

    @Schema(description = "样式属性（其他样式扩展）")
    @Size(max = 100, message = "样式属性不能超过{max}个字符", groups = {AddGroup.class, EditGroup.class})
    private String cssClass;

    @Schema(description = "表格回显样式")
    @Size(max = 100, message = "表格回显样式不能超过{max}个字符", groups = {AddGroup.class, EditGroup.class})
    private String listClass;

    @Schema(description = "状态（1正常 0停用）")
    @NotBlank(message = "状态不能为空", groups = {AddGroup.class, EditGroup.class})
    @Size(max = 1, message = "状态不能超过{max}个字符", groups = {AddGroup.class, EditGroup.class})
    private String status;

    @Schema(description = "备注")
    @Size(max = 500, message = "备注不能超过{max}个字符", groups = {AddGroup.class, EditGroup.class})
    private String remark;
}
